home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-2.dms / in.adf / MUIClass.Lha / Include / Classes / TWiMUI / Application.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-06  |  6.7 KB  |  156 lines

  1. //
  2. //  $VER: Application.h 1.2 (02 Sep 1996)
  3. //
  4. //    c 1996 Thomas Wilhelmi
  5. //
  6. //
  7. // Address : Taunusstrasse 14
  8. //           61138 Niederdorfelden
  9. //           Germany
  10. //
  11. //  E-Mail : willi@twi.rhein-main.de
  12. //
  13. //   Phone : +49 (0)6101 531060
  14. //   Fax   : +49 (0)6101 531061
  15. //
  16. //
  17. //  $HISTORY:
  18. //
  19. //  16 Jun 1996 :   1.0 : first public Release
  20. //
  21. //  02 Sep 1996 :   1.2 : Neu:
  22. //                        - Die Methode PushMethod hatte ich vergessen.
  23. //                        - ClassNum() für Exception-Handling.
  24. //                        Änderungen
  25. //                        - Parameter des Copy-Konstruktor als 'const'-Parameter definiert
  26. //
  27.  
  28. #ifndef CPP_TWIMUI_APPLICATION_H
  29. #define CPP_TWIMUI_APPLICATION_H
  30.  
  31. #ifndef CPP_TWIMUI_NOTIFY_H
  32. #include <classes/twimui/notify.h>
  33. #endif
  34.  
  35. #ifndef CPP_TWIMUI_WINDOW_H
  36. #include <classes/twimui/window.h>
  37. #endif
  38.  
  39. #ifndef LIBRARIES_COMMODITIES_H
  40. #include <libraries/commodities.h>
  41. #endif
  42.  
  43. #ifndef UTILITY_HOOKS_H
  44. #include <utility/hooks.h>
  45. #endif
  46.  
  47. class MUIApplicationBrokerHook
  48.     {
  49.     private:
  50.         struct Hook brokerhook;
  51.         static void BrokerHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 CxMsg *);
  52.         virtual void BrokerHookFunc(struct Hook *, Object *, CxMsg *);
  53.     protected:
  54.         MUIApplicationBrokerHook();
  55.         MUIApplicationBrokerHook(const MUIApplicationBrokerHook &);
  56.         ~MUIApplicationBrokerHook();
  57.         MUIApplicationBrokerHook &operator= (const MUIApplicationBrokerHook &);
  58.     public:
  59.         struct Hook *broker() { return(&brokerhook); };
  60.     };
  61.  
  62. class MUIApplicationRexxHook
  63.     {
  64.     private:
  65.         struct Hook rexxhook;
  66.         static ULONG RexxHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 struct RexxMsg *);
  67.         virtual ULONG RexxHookFunc(struct Hook *, Object *, struct RexxMsg *);
  68.     protected:
  69.         MUIApplicationRexxHook();
  70.         MUIApplicationRexxHook(const MUIApplicationRexxHook &p);
  71.         ~MUIApplicationRexxHook();
  72.         MUIApplicationRexxHook &operator= (const MUIApplicationRexxHook &);
  73.     public:
  74.         struct Hook *rexx() { return(&rexxhook); };
  75.     };
  76.  
  77. class MUIApplication
  78.     :   public MUINotify,
  79.         public MUIApplicationBrokerHook,
  80.         public MUIApplicationRexxHook
  81.     {
  82.     private:
  83.         virtual ULONG Dispatch(struct IClass *, Object *, Msg);
  84.     protected:
  85.         virtual const ULONG ClassNum() const;
  86.     public:
  87.         MUIApplication(const struct TagItem *t)
  88.             :   MUINotify(MUIC_Application),
  89.                 MUIApplicationBrokerHook(),
  90.                 MUIApplicationRexxHook()
  91.             {
  92.             init(t);
  93.             };
  94.         MUIApplication(const Tag, ...);
  95.         MUIApplication()
  96.             :   MUINotify(MUIC_Application),
  97.                 MUIApplicationBrokerHook(),
  98.                 MUIApplicationRexxHook()
  99.             { };
  100.         MUIApplication(const MUIApplication &);
  101.         virtual ~MUIApplication();
  102.         MUIApplication &operator= (const MUIApplication &);
  103.         void Loop();
  104.         void Active(const BOOL p) { set(MUIA_Application_Active,(ULONG)p); };
  105.         BOOL Active() const { return((BOOL)get(MUIA_Application_Active, FALSE)); };
  106.         STRPTR Author() const { return((STRPTR)get(MUIA_Application_Author)); };
  107.         STRPTR Base() const { return((STRPTR)get(MUIA_Application_Base)); };
  108.         struct NewBroker *Broker() const { return((struct NewBroker *)get(MUIA_Application_Broker)); };
  109.         void BrokerHook(const struct Hook *p) { set(MUIA_Application_BrokerHook,(ULONG)p); };
  110.         struct Hook *BrokerHook() const { return((struct Hook *)get(MUIA_Application_BrokerHook)); };
  111.         struct MsgPort *BrokerPort() const { return((struct MsgPort *)get(MUIA_Application_BrokerPort)); };
  112.         LONG BrokerPri() const { return((LONG)get(MUIA_Application_BrokerPri,0L)); };
  113.         void Commands(const struct MUI_Commands *p) { set(MUIA_Application_Commands,(ULONG)p); };
  114.         struct MUI_Commands *Commands() const { return((struct MUI_Commands *)get(MUIA_Application_Commands)); };
  115.         STRPTR Copyright() const { return((STRPTR)get(MUIA_Application_Copyright)); };
  116.         STRPTR Description() const { return((STRPTR)get(MUIA_Application_Description)); };
  117.         void DiskObject(const struct DiskObject *p) { set(MUIA_Application_DiskObject,(ULONG)p); };
  118.         struct DiskObject *DiskObject() const { return((struct DiskObject *)get(MUIA_Application_DiskObject)); };
  119.         BOOL DoubleStart() const { return((BOOL)get(MUIA_Application_DoubleStart,FALSE)); };
  120.         void DropObject(const Object *p) { set(MUIA_Application_DropObject,(ULONG)p); };
  121.         BOOL ForceQuit() const { return((BOOL)get(MUIA_Application_ForceQuit,FALSE)); };
  122.         void HelpFile(const STRPTR p) { set(MUIA_Application_HelpFile,(ULONG)p); };
  123.         STRPTR HelpFile() const { return((STRPTR)get(MUIA_Application_HelpFile)); };
  124.         void Iconified(const BOOL p) { set(MUIA_Application_Iconified,(ULONG)p); };
  125.         BOOL Iconified() const { return((BOOL)get(MUIA_Application_Iconified,FALSE)); };
  126.         ULONG MenuAction() const { return(get(MUIA_Application_MenuAction,0L)); };
  127.         ULONG MenuHelp() const { return(get(MUIA_Application_MenuHelp,0L)); };
  128.         void RexxHook(const struct Hook *p) { set(MUIA_Application_RexxHook,(ULONG)p); };
  129.         struct Hook *RexxHook() const { return((struct Hook *)get(MUIA_Application_RexxHook)); };
  130.         struct RxMsg *RexxMsg() const { return((struct RxMsg *)get(MUIA_Application_RexxMsg)); };
  131.         void RexxString(const STRPTR p) { set(MUIA_Application_RexxString,(ULONG)p); };
  132.         void Sleep(const BOOL p) { set(MUIA_Application_Sleep,(ULONG)p); };
  133.         STRPTR Title() const { return((STRPTR)get(MUIA_Application_Title)); };
  134.         STRPTR Version() const { return((STRPTR)get(MUIA_Application_Version)); };
  135.         void AboutMUI(Object *p = NULL) { dom(MUIM_Application_AboutMUI,(ULONG)p); };
  136.         void AddInputHandler(struct MUI_InputHandlerNode *p) { dom(MUIM_Application_AddInputHandler,(ULONG)p); };
  137.         void CheckRefresh() { dom(MUIM_Application_CheckRefresh); };
  138.         void InputBuffered() { dom(MUIM_Application_InputBuffered); };
  139.         void Load(STRPTR p) { dom(MUIM_Application_Load,(ULONG)p); };
  140.         void LoadENV() { dom(MUIM_Application_Load,(ULONG)MUIV_Application_Load_ENV); };
  141.         void LoadENVARC() { dom(MUIM_Application_Load,(ULONG)MUIV_Application_Load_ENVARC); };
  142.         ULONG NewInput(LONGBITS *p) { return(dom(MUIM_Application_NewInput,(ULONG)p)); };
  143.         void OpenConfigWindow(ULONG p) { dom(MUIM_Application_OpenConfigWindow,p); };
  144.         BOOL PushMethod(Object *, LONG, ...);
  145.         void RemInputHandler(struct MUI_InputHandlerNode *p) { dom(MUIM_Application_RemInputHandler,(ULONG)p); };
  146.         void ReturnID(ULONG p) { dom(MUIM_Application_ReturnID,p); };
  147.         void Save(STRPTR p) { dom(MUIM_Application_Save,(ULONG)p); };
  148.         void SaveENV() { dom(MUIM_Application_Save,(ULONG)MUIV_Application_Save_ENV); };
  149.         void SaveENVARC() { dom(MUIM_Application_Save,(ULONG)MUIV_Application_Save_ENVARC); };
  150.         void ShowHelp(Object *p1, STRPTR p2, STRPTR p3, LONG p4) { dom(MUIM_Application_ShowHelp,(ULONG)p1,(ULONG)p2,(ULONG)p3,(ULONG)p4); };
  151.         void Add(MUIWindow &p) { dom(OM_ADDMEMBER,(ULONG)((Object *)p)); p.ParSwitchSet(Obj); };
  152.         void Rem(MUIWindow &p) { dom(OM_REMMEMBER,(ULONG)((Object *)p)); p.ParSwitchClear(); };
  153.     };
  154.  
  155. #endif
  156.